package com.example.myapplication001.slice.home_page;

import com.example.myapplication001.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.ability.AbilitySliceAnimator;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;
import ohos.agp.components.Image;

//主页亲友
public class FriendsAbilitySlice extends AbilitySlice {

    private  AbilitySliceAnimator animator;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_friends);

        animator = new AbilitySliceAnimator(1080,0,0,0);
        animator.setDelay(3);
        animator.setDuration(5);
        animator.setRepeatCount(5);

        Button button_jk =(Button) findComponentById(ResourceTable.Id_button_jk);
        button_jk.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MainAbilitySlice
                present(new MainAbilitySlice(),new Intent());
            }
        });

        Image image_jk =(Image) findComponentById(ResourceTable.Id_image_jk);
        image_jk.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MainAbilitySlice
                present(new MainAbilitySlice(),new Intent());
            }
        });

        Button button_wd =(Button) findComponentById(ResourceTable.Id_button_wd);
        button_wd.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MyAbilitySlice
                present(new MyAbilitySlice(),new Intent());
            }
        });

        Image image_wd =(Image) findComponentById(ResourceTable.Id_image_wd);
        image_wd.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MyAbilitySlice
                present(new MyAbilitySlice(),new Intent());
            }
        });
    }
}
